package cn.edu.zzuli.nothinglink.mapper.provider;

import java.util.List;

public class WorkProvider {

    public String getCourseWorks(List<Integer> courseIds) {

        StringBuilder sb = new StringBuilder();
        sb.append("SELECT * FROM work WHERE course_id in (");
        for (int i = 0; i < courseIds.size(); i++) {
            if (i != courseIds.size() - 1) {
                sb.append(courseIds.get(i) + ", ");
            }else {
                sb.append(courseIds.get(i) + ")");
            }
        }

        return sb.toString() + " AND deleted = 0 ORDER BY is_end ASC, end_time ASC";
    }

}
